package com.jlnk.androidfmc;

import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.widget.LinearLayout;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

public class ThirdActivity extends AppCompatActivity {

  private LinearLayout containerSettings;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    EdgeToEdge.enable(this);
    setContentView(R.layout.activity_third);
    ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
      Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
      v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
      return insets;
    });
    // 沉浸状态栏
    Tools.setSystemBarColorInt(this, Color.parseColor("#CC64E8CA"));
    init();
  }

  private void init() {
    initView();
    initAction();
  }

  private void initView() {
    containerSettings = findViewById(R.id.settings_container);
  }

  private void initAction() {
    containerSettings.setOnClickListener(v -> {
      startActivity(new Intent(ThirdActivity.this, SettingsActivity.class));
    });
  }
}